package cn.bdqn.aop;

import java.util.Arrays;

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;

public class TheLogger {
	private static final Logger logger=Logger.getLogger(TheLogger.class);
	//代表前置增强
	public void before(JoinPoint jp) {
		logger.info("调用了："+jp.getTarget()+"的，"+jp.getSignature().getName()+"方法入参"+Arrays.toString(jp.getArgs()));
	}
	//代表后置增强
	public void after(JoinPoint jp,Object result) {
		logger.info("调用了："+jp.getTarget()+"的，"+jp.getSignature().getName()+"返回："+result);
	}
}
